#include <bits/stdc++.h>
#define int long long
using namespace std;

int n, r[100005], cnt, now, nnt, ans;
signed main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin >> n;
    ans = n;
    for (int i = 1; i <= n; i++) cin >> r[i];
    sort(r + 1, r + n + 1);
    for (int i = 1; i <= n; i++)
    {
        if (r[i] != now)
        {
            now = r[i];
            cnt += nnt;
            nnt = 0;
        }
        nnt++;
        if (cnt > 0)
        {
            cnt--;
            ans--;
        }
    }
    cout << ans << endl;
    return 0;
}
